package com.gitee.pifeng.monitoring.ui.business.web.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.pifeng.monitoring.common.inf.ISuperBean;
import com.gitee.pifeng.monitoring.ui.business.web.entity.TLinkLatest;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.sql.Time;

@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "数链详情数据")
public class TLinkLatestVo implements ISuperBean {

    private String source;

    private String method;

    private String target;

    private String subLinkName;

    private String processName;

    private String runningOn;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String latestCheckTime;

    private String latestProcessStat;

    private String subLinkAilas;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Time lagTime;

    private String ailasSource;

    private String aliasTarget;

    //方便前端使用
    private String sourceLabel;

    private String targetLabel;

    private String showName;

    private Integer abnormal;

    public TLinkLatestVo convertFor(TLinkLatest tLinkLatest) {
        if (null != tLinkLatest) {
            BeanUtils.copyProperties(tLinkLatest, this);
        }
        return this;
    }

}
